#include "IndexBuffer.h"
#include <SERender/Util/Util.h>
#include <glad/glad.h>

namespace SEngine
{

    IndexBuffer::IndexBuffer()
    { 
        glCall(glGenBuffers(1, &m_id)); 
    }

    IndexBuffer::~IndexBuffer()
    { 
        glDeleteBuffers(1, &m_id); 
    }

    void IndexBuffer::Bind()
    { 
        glCall(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_id));
    }

    void IndexBuffer::Unbind()
    { 
        glCall(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0)); 
    }

} // namespace SEngine
